package edu.office.applicationRepository;

import edu.office.entities.WrongReason;
import edu.office.tools.EOMessage;
import edu.office.tools.EOMessage1;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Named;

@Named("wrongReasonRepositoryA")
@ApplicationScoped
public class WrongReasonRepository   extends ApplicationCommonRepository<WrongReason>{

    public String mycreate(WrongReason wrongReason) {
        if (list("NAME", wrongReason.getNAME()).isEmpty()) {
            create(wrongReason);
            return EOMessage.getEOMessageENUM(EOMessage1.Succeed);
        } else {
            return wrongReason.getNAME() + ":" + EOMessage.getEOMessageENUM(EOMessage1.Already_Exist);
        }
    }

}
